﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using eProject_SEM3_SecurityServices.ObjectClass;
using System.Data.SqlClient;
using System.Data;

namespace eProject_SEM3_SecurityServices.DataAccess
{
    public class DContract
    {
        public bool NewContractAdd(OContract contract)
        {
            SqlParameter[] parameters = new SqlParameter[]
            {                
               new SqlParameter("@contractId",contract.ContractId),
               new SqlParameter("@serviceId",contract.ServiceId)
            };

            return DConnectSQL.ExecuteNonQuery("sp_AddnewContract", CommandType.StoredProcedure, parameters);
        }

        public bool deleteContract(int id)
        {
            SqlParameter[] para = new SqlParameter[]
            {
                new SqlParameter("@contractId",id)
            };
            return DConnectSQL.ExecuteNonQuery("@DeleteContract",CommandType.StoredProcedure, para);
        }
    }
}